package com.huike.business.mapper;

import java.util.List;
import com.huike.business.domain.TbBusinessTrackRecord;
import com.huike.business.domain.vo.BusinessTrackVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 商机跟进记录Mapper接口
 * @date 2021-04-28
 */
public interface TbBusinessTrackRecordMapper {


    void updateBusiness(BusinessTrackVo businessTrackVo);

    void addBusinessTrackRecord(BusinessTrackVo businessTrackVo);


    List<TbBusinessTrackRecord> listRecords(Long id);

    @Select("select dict_label from sys_dict_data where dict_value=#{keyItems} and dict_type ='communication_point'")
    String getKays(@Param("keyItems") String keyItems);

    @Insert("insert into tb_business_track_record (business_id, create_time, type, false_reason)\n" +
            "VALUES (#{id},now(),1,#{reason}) ")
    void insertBusinessTrackRecord(@Param("id") Long id, @Param("reason") String reason);

    String getReason(@Param("reason") String reason);
}